//package cn.yup.web.interceptor;
//
//import cn.yup.domain.Employee;
//import cn.yup.util.UserContext;
//import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
//public class CheckLoginInterceptor extends HandlerInterceptorAdapter {
//    @Override
//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
//            throws Exception {
//        System.out.println("CheckLoginInterceptor.preHandle");
//        Employee employee =UserContext.getCurrentUser();
//        if (employee == null) {
//            response.sendRedirect("/login.html");
//            return false;
//        }
//    return true;
//    }
//
//}
